package com.ve.downloader;


//import com.fazecast.jSerialComm.SerialPort;

public class Test {/*
    public static void main(String[] args) {
        new Test().run();
    }

    byte[] buffer;


    String path = "D:\\Program Files (x86)\\SDCC\\bin\\led.hex";

    private void run() {
        buffer = new byte[102400];


        Programmer programmer = new Programmer(new JavaSerial());
        programmer.downloadHex(path);
    }


    private class JavaSerial extends BufferSerial {

        SerialPort port;

        JavaSerial() {
            port = SerialPort.getCommPorts()[0];
            port.setBaudRate(9600);
            port.openPort();

        }

        @Override
        public void setBaudrate(int baudrate) {
            port.setBaudRate(baudrate);
        }

        @Override
        public int getBaudrate() {
            return port.getBaudRate();
        }

        @Override
        public int read(byte[] buff, int size) {
            return port.readBytes(buff, size);
        }

        @Override
        public void write(byte[] bytes) {
            port.writeBytes(bytes, bytes.length);
        }

        @Override
        public void setParity(boolean parity) {

        }
    }*/
}
